package phapp.dao.barapp;

import java.util.List;
import java.util.Map;

import javacommon.base.*;
import cn.org.rapid_framework.page.*;
import org.springframework.stereotype.Component;

import phapp.model.barapp.*;

/**
  * <p> 标题: 酒吧台桌 ,tc_bar_desk_info 数据处理层
  * Description : 执行./mapper/的BarDeskMapper.xml的相应SQL语句
  * Copyright: Copyright (c) 2014-10
  * Company:
  * @see phapp.model.barapp.BarDesk
  * @author you name
  * @version 1.0
*/

@Component
public class BarDeskDao extends BaseIbatis3Dao<BarDesk,java.lang.Integer>{

   public Class getEntityClass() {
      return BarDesk.class;
   }
   /**
   * <p> 标题:修改和新增<br>
   * <p>Description :
   * @param BarDesk u 
   * @author
   */
   public void saveOrUpdate(BarDesk entity) {
      if(entity.getId() == null)
         save(entity);
      else
         update(entity);
   }

   /**
   * <p> 标题:批量删除<br>
   * <p>Description :
   * @param BarDesk u
   * @return int
   * @author
   */
   public int removeByIdArry(BarDesk u) {
      int i=-1;
      i =delete("BarDesk.removeByIdArry", u);
      return i;
   }
   /**
   * <p> 标题:分页查询<br>
   * <p>Description :
   * @param PageRequest pageRequest
   * @return Page
   * @author
   */
   public Page findByPageRequest(PageRequest pageRequest) {
      return pageQuery("BarDesk.pageSelect",pageRequest);
   }


   /**
   * <p> 标题:按Bean查询返回List<br> 
   * @param BarDesk bean
   * @return List
   * @author
   */
   public java.util.List findListByBean(BarDesk bean){
	   return  getSqlSessionTemplate().selectList("BarDesk.findListByBean",bean);
   }
   
	/**
	   * <p>按Map查询返回List + 在线人数<br> 
	   * @param Map map
	   * @return List
	   * @author
	 */
	public   List findListOnile(Map map){
		java.util.List<BarDesk> list =  getSqlSessionTemplate().selectList("BarDesk.findListOnile",map);
	    return list;
	}
   
	   /**
		* <p>通过 Map 修改一条 数据<br> 
		* @param  java.util.Map 
	   */
	   public int updateByMap(java.util.Map map){
	  		int count = getSqlSessionTemplate().update("BarDesk.update",map);
	  		return count;
	  }

   
   
}
